package com.fan.leetcode;

import org.junit.jupiter.api.Test;

/**
 * @author ZhangFan
 * @since 2021/7/24 下午 3:08
 */
public class Question1736 {
    @Test
    public void test() {
        System.out.println(maximumTime("2?:?0"));
    }
    public String maximumTime(String time) {
        String str = time.replaceAll("^([01])\\?", "$19")
                .replaceAll("^2\\?", "23")
                .replaceAll("^\\?([0-3])", "2$1")
                .replaceAll("^\\?([4-9])", "1$1")
                .replaceAll("^\\?{2}", "23")
                .replaceAll("([0-5])\\?$", "$19")
                .replaceAll("\\?([0-9])", "5$1")
                .replaceAll("\\?{2}", "59");
        return str;
    }
}
